package com.wushijia.highconcurrency.lock;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerArray;

public class AtomicIntegerArrayDemo {

  final AtomicIntegerArray array = new AtomicIntegerArray(10);

  public class AddThread implements Runnable {

    @Override
    public void run() {
      for (int k = 0; k < 10000; k++) {
        array.getAndIncrement(k % array.length());
      }
    }
  }
}
